package com.tbit.uqbike.webmanager.dao.log;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.tbit.config.datasource.DataSource;
import com.tbit.uqbike.object.pojo.BmsAbnormalVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 云bms电池异常表
 *
 * @Author:BUGTian
 * @DATE: 2022/8/16
 */
@DS(DataSource.LOG)
public interface BmsAbnormalDao {

    /**
     * 删除未处理异常，已处理异常保留
     *
     * @param bmsBatteryNoList
     */
    void deleteBmsBatteryAbNormal(@Param("bmsBatteryNoList") List<String> bmsBatteryNoList);

    /**
     * 查询bms电池异常分析信息
     *
     * @param accountId
     * @param adAccountId
     * @param batteryNO
     * @param startTime
     * @param endTime
     * @param handle
     * @param abnormalType
     * @return
     */
    List<BmsAbnormalVO> queryPageBmsAbnormal(@Param("accountId") Integer accountId, @Param("adAccountId") Integer adAccountId, @Param("batteryNO") String batteryNO, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("handle") Integer handle, @Param("abnormalType") Integer abnormalType);

    /**
     * 清除bms电池异常
     *
     * @param batteryNO
     * @param abnormalType
     * @param addTime
     */
    void updateBmsAbnormal(@Param("batteryNO") String batteryNO, @Param("abnormalType") Integer abnormalType, @Param("addTime") Date addTime);


    /**
     * 查询云bms电池异常数量
     *
     * @param batteryNO
     * @return
     */
    Integer selectBmsBatteryAbnormalCount(@Param("batteryNO") String batteryNO);

}
